<?php


namespace app\api\controller;


use app\admin\model\dz\Bm;
use app\admin\model\dz\Cx;
use app\admin\model\dz\Img;
use app\admin\model\dz\Jxs;
use app\common\controller\Api;
use think\Console;

class Dz extends Api
{
    public $noNeedLogin = '*';
    public function postBm(){
        if ($this->request->isPost()) {
            $data = $this->request->post();

            $a= Bm::create($data);
            if ($a) {
                return $this->success('成功', $a);
            }
            return $this->success('失败', '', 0);
        }
    }
    public function getJxs(){
        return json(Jxs::where(['switch' => 1])->order('weigh desc')->select());
    }
    public function getCx(){
        return json(Cx::where(['switch' => 1])->order('weigh desc')->select());
    }
    public function getImg(){
        return json(Img::where(['switch' => 1])->order('weigh desc')->select());
    }
}